{"ast":null,"code":"import React from\"react\";import{getUserName}from\"../../utils/User\";import\"./Name.scss\";import{jsx as _jsx}from\"react/jsx-runtime\";import{Fragment as _Fragment}from\"react/jsx-runtime\";var Name=function Name(_ref){var chatName=_ref.chatName,multiChat=_ref.multiChat,user=_ref.user;if(chatName&&chatName.length>0&&multiChat){return/*#__PURE__*/_jsx(\"p\",{className:\"dialogs__item-chatName\",children:chatName});}else if(multiChat===false&&user){return/*#__PURE__*/_jsx(\"p\",{className:\"dialogs__item-chatName\",children:getUserName(user)});}else{if(user){return/*#__PURE__*/_jsx(\"div\",{className:\"message__name\",children:user.firstName?/*#__PURE__*/_jsx(\"p\",{className:\"message__name--normalName\",children:user.firstName}):/*#__PURE__*/_jsx(\"p\",{className:\"message__name--nickname\",children:user.nickname})});}else{return/*#__PURE__*/_jsx(_Fragment,{});}}};export default Name;","map":{"version":3,"names":["React","getUserName","Name","chatName","multiChat","user","length","firstName","nickname"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/src/components/Name/index.tsx"],"sourcesContent":["import React from \"react\";\nimport {getUserName} from \"../../utils/User\";\nimport {NameProps} from \"../../models/props/NameProps\";\nimport \"./Name.scss\";\n\nconst Name: React.FC<NameProps> = ({chatName, multiChat, user}) => {\n\n    if (chatName && chatName.length > 0 && multiChat) {\n        return (\n            <p className='dialogs__item-chatName'>{chatName}</p>\n        );\n    } else if (multiChat === false && user) {\n        return (\n            <p className='dialogs__item-chatName'>\n                {getUserName(user)}\n            </p>\n        );\n    } else {\n        if (user) {\n            return (\n                <div className='message__name'>\n                    {(user.firstName)\n                        ?<p className='message__name--normalName'>{user.firstName}</p>\n                        :<p className='message__name--nickname'>{user.nickname}</p>\n                    }\n                </div>\n            );\n        } else {\n            return (<></>);\n        }\n    }\n}\n\nexport default Name;\n"],"mappings":"AAAA,MAAOA,MAAK,KAAM,OAAO,CACzB,OAAQC,WAAW,KAAO,kBAAkB,CAE5C,MAAO,aAAa,CAAC,gGAErB,GAAMC,KAAyB,CAAG,QAA5BA,KAAyB,MAAoC,IAA/BC,SAAQ,MAARA,QAAQ,CAAEC,SAAS,MAATA,SAAS,CAAEC,IAAI,MAAJA,IAAI,CAEzD,GAAIF,QAAQ,EAAIA,QAAQ,CAACG,MAAM,CAAG,CAAC,EAAIF,SAAS,CAAE,CAC9C,mBACI,UAAG,SAAS,CAAC,wBAAwB,UAAED,QAAQ,EAAK,CAE5D,CAAC,IAAM,IAAIC,SAAS,GAAK,KAAK,EAAIC,IAAI,CAAE,CACpC,mBACI,UAAG,SAAS,CAAC,wBAAwB,UAChCJ,WAAW,CAACI,IAAI,CAAC,EAClB,CAEZ,CAAC,IAAM,CACH,GAAIA,IAAI,CAAE,CACN,mBACI,YAAK,SAAS,CAAC,eAAe,UACxBA,IAAI,CAACE,SAAS,cACX,UAAG,SAAS,CAAC,2BAA2B,UAAEF,IAAI,CAACE,SAAS,EAAK,cAC7D,UAAG,SAAS,CAAC,yBAAyB,UAAEF,IAAI,CAACG,QAAQ,EAAK,EAE7D,CAEd,CAAC,IAAM,CACH,mBAAQ,kBAAK,CACjB,CACJ,CACJ,CAAC,CAED,cAAeN,KAAI"},"metadata":{},"sourceType":"module"}